package com.xszx.entity.enums;

public enum ConStatusEnum {

    alreadyPassed(1, "已通过"),

    notPass(2, "未通过"),

    theApprovalIsPending(0, "待审批");

    private final int id;

    private final String name;

    public int getId(){return id;}

    public String getName() {
        return name;
    }

    ConStatusEnum(int id, String name) {
        this.id = id;
        this.name = name;
    }

    public static String getName(int id){
        for (ConStatusEnum conStatusEnum : ConStatusEnum.values()) {
            if(conStatusEnum.getId() == id){
                return conStatusEnum.getName();
            }
        }
        throw  new IllegalArgumentException("没有获取到值");
    }
}
